﻿using Test30.Core;

namespace Test30.Engine
{
    public class ElementConeAction : ConeAction
    {
        public ElementConeAction(Entity owner, Vec target, int radius, INoun noun, Attack attack)
            : base(owner, target, radius)
        {
            _noun = noun;
            _attack = attack;
        }

        protected override void OnEffect(Vec pos, Direction direction, bool leadingEdge)
        {
            if (leadingEdge)
            {
                Dungeon.HitAt(pos, this, new Hit(_noun, _attack, direction));
            }
        }

        private readonly INoun _noun;
        private readonly Attack _attack;
    }
}
